{template '_header'}



<div class="page-heading"> 

	

	<span class='pull-right'>

		

		{ifp 'groups.adv.add'}

                            <a class="btn btn-primary btn-sm" href="{php echo webUrl('groups/adv/add')}">添加新幻灯片</a>

		{/if}

                

		<a class="btn btn-default  btn-sm" href="{php echo webUrl('groups/adv')}">返回列表</a>

                

                

	</span>

	<h2>{if !empty($item['id'])}编辑{else}添加{/if}幻灯片 <small>{if !empty($item['id'])}修改【{$item['advname']}】{/if}</small></h2> 

</div>

 

 

    <form {ife 'groups.adv' $item}action="" method="post"{/if} class="form-horizontal form-validate" enctype="multipart/form-data">

        <input type="hidden" name="id" value="{$item['id']}" />

 

                <div class="form-group">

                    <label class="col-sm-2 control-label">排序</label>

                    <div class="col-sm-9 col-xs-12">

                        {ife 'groups.adv' $item}

                                <input type="text" name="displayorder" class="form-control" value="{$item['displayorder']}" />

                                <span class='help-block'>数字越大，排名越靠前</span>

                        {else}

                            <div class='form-control-static'>{$item['displayorder']}</div>

                        {/if}

                    </div>

                </div>

                <div class="form-group">

                    <label class="col-sm-2 control-label must">幻灯片标题</label>

                    <div class="col-sm-9 col-xs-12 ">

                         {ife 'groups.adv' $item}

                        <input type="text" id='advname' name="advname" class="form-control" value="{$item['advname']}" data-rule-required="true" />

                         {else}

                        <div class='form-control-static'>{$item['advname']}</div>

                        {/if}

                    </div>

                </div>

                <div class="form-group">

                    <label class="col-sm-2 control-label">幻灯片图片</label>

                    <div class="col-sm-9 col-xs-12">

                         {ife 'groups.adv' $item}

                        {php echo tpl_form_field_image('thumb', $item['thumb'])}

                        <span class='help-block'>建议尺寸:640 * 350 , 请将所有幻灯片图片尺寸保持一致</span>

                        {else}

                            {if !empty($item['thumb'])}

                                  <a href='{php echo tomedia($item['thumb'])}' target='_blank'>

                            <img src="{php echo tomedia($item['thumb'])}" style='width:100px;border:1px solid #ccc;padding:1px' />

                                  </a>

                            {/if}

                        {/if}

                    </div>

                </div>

                <div class="form-group">

                    <label class="col-sm-2 control-label">幻灯片连接</label>

                    <div class="col-sm-9 col-xs-12">

                         {ife 'groups.adv' $item}
                        <div class="input-group form-group" style="margin: 0;">
                            <input type="text" value="{$item['link']}" class="form-control valid" name="link" placeholder="" id="advlink">
                            <span data-input="#advlink" data-toggle="selectUrl" class="input-group-addon btn btn-default">选择链接</span>
                        </div>
                        {else}

                        <div class='form-control-static'>{$item['link']}</div>

                        {/if}

                    </div>

                </div>

                <div class="form-group">

                    <label class="col-sm-2 control-label">状态</label>

                    <div class="col-sm-9 col-xs-12">

                            {ife 'groups.adv' $item}

                        <label class='radio-inline'>

                            <input type='radio' name='enabled' value=1' {if $item['enabled']==1}checked{/if} /> 显示

                        </label>

                        <label class='radio-inline'>

                            <input type='radio' name='enabled' value=0' {if $item['enabled']==0}checked{/if} /> 隐藏

                        </label>

                     {else}

                            <div class='form-control-static'>{if empty($item['enabled'])}隐藏{else}显示{/if}</div>

                        {/if}

                    </div>

                </div>

            

            <div class="form-group">

                    <label class="col-sm-2 control-label"></label>

                    <div class="col-sm-9 col-xs-12">

                           {ife 'groups.adv' $item}

                            <input type="submit" value="提交" class="btn btn-primary"  />

                            

                        {/if}

                       <input type="button" name="back" onclick='history.back()' {ifp 'groups.adv.add|groups.adv.edit'}style='margin-left:10px;'{/if} value="返回列表" class="btn btn-default" />

                    </div>

            </div>

 

    </form>

 



<script language='javascript'>

    function formcheck() {

        if ($("#advname").isEmpty()) {

            Tip.focus("advname", "请填写幻灯片名称!");

            return false;

        }

        return true;

    }

</script>



{template '_footer'}